﻿using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class TestConnectionRequest : BaseRequest
{

	private TestConnectionPanel _testConnectionPanel;
	
	protected override void Awake()
	{
		_controllerType = ControllerType.TEST;
		_methodType = MethodType.TEST;
		base.Awake();
	}

	void Start ()
	{
		_testConnectionPanel = this.gameObject.GetComponent<TestConnectionPanel>();
	}

	public void SendRequest(int num)
	{
		NettyRequest nettyRequest = new NettyRequest();
		nettyRequest.controllerType = (int) _controllerType;
		nettyRequest.methodType = (int) _methodType;
		nettyRequest.data = num.ToString();
		byte[] dataBytes = ConverterTool.SerialRequestObj(nettyRequest);
		UnityFacade.Instance.ClientManager.SendMsgToServer(dataBytes);
	}
	public override void OnResponse(string data)
	{
		_testConnectionPanel.HandleResponse(data);
	
	}

	// Use this for initialization
	
	
	// Update is called once per frame
	void Update () {
		
	}
}
